{% extends "shared/layout.volt" %}
{% block content %}
<h1 class="page-header">
    商户列表
    <a href="{{ url("merchant/edit") }}" class="btn btn-default btn-sm pull-right"><i class="glyphicon glyphicon-plus"></i> 新增数据</a>
</h1>
    <div class="table-responsive">
        <table class="table-tidy">
            <thead class="table-tidy-head">
            <tr>
                <th style="width: 260px;">商户编号</th>
                <th>商户名称</th>
                <th style="width: 160px;">创建时间</th>
                <th style="width: 120px;">商户状态</th>
                <th style="width: 120px;">操作设置</th>
            </tr>
            </thead>
            <tbody class="table-tidy-body">
            {% for item in Model.items %}
                <tr>
                    <td>{{ item.merchant_id }}</td>
                    <td>
                        <img src="{{ item.merchant_image_url }}" onerror="this.src='/assets/images/app.png'" style="display: inline-block;width: 40px;height: 40px;margin-right: 20px;">
                        <span class="text-name">{{ item.merchant_name }}</span>
                    </td>

                    <td>{{ item.create_time }}</td>
                    <td>
                        {% if item.merchant_status == 'y' %}
                            <span class="label-yes"><i class="glyphicon glyphicon-ok-circle"></i> 启用</span>
                        {% else %}
                            <span class="label-no"><i class="glyphicon glyphicon-ban-circle"></i> 停用</span>
                        {% endif %}

                    </td>

                    <td>
                        <a href="{{ url('merchant/detail') }}?mch_id={{ item.merchant_id }}"> 查看</a> |
                        <a href="{{ url('merchant/edit') }}?mch_id={{ item.merchant_id }}"> 编辑</a>
                    </td>
                </tr>
            {% else %}
                <tr>
                    <td colspan="7" class="text-center">暂无记录</td>
                </tr>
            {% endfor %}
            </tbody>
        </table>
        <div class="page pagination">
            <?php echo $Model->getPaginate();?>
        </div>
    </div>
{% endblock %}